/*******************************************************************************
 * Copyright 2011 @ Kapil Viren Ahuja
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/
package com.kapil.framework.logger;

/**
 * <p>
 * Interface for Logging messages using an existing logging framework. Exposes methods for the following basic
 * functionalities:
 * 
 * <ul>
 * <li>Logging {@link String} messages.</li>
 * <li>Logging messages and replacing the tokens provided as method parameters.</li>
 * <li>Logging {@link Object}.</li>
 * </ul>
 * </p>
 * 
 */
public interface ILogger
{ // NOPMD because a Logger class is designed to have these many methods.
    /**
     * Logs messages to level <code>Trace</code>.
     * 
     * @param message message of type {@link String} that needs to be logged.
     */
    void trace(String message);

    /**
     * Logs messages replacing all tokens <code>##</code> with replacements to level <code>Trace</code>.
     * 
     * @param message message of type {@link String} that needs to be logged.
     * @param replacements an Array of {@link String} replacements that will replace the tokens <code>##</code> in the
     *            message
     */
    void trace(String message, String[] replacements);

    /**
     * Logs messages replacing token <code>##</code> with replacements to level <code>Trace</code>.
     * 
     * @param message message of type {@link String} that needs to be logged.
     * @param replacement a {@link String} that will replace the tokens <code>##</code> in the message.
     */
    void trace(String message, String replacement);

    /**
     * Logs messages to level <code>Trace</code>. While providing implementations, developers can choose to log the
     * object as a <code>object.toString()</code> or converting them to XMLs.
     * 
     * @param object object that needs to be logged.
     */
    void trace(Object object);

    /**
     * Logs messages to level <code>Debug</code>.
     * 
     * @param message message of type {@link String} that needs to be logged.
     */
    void debug(String message);

    /**
     * Logs messages replacing all tokens <code>##</code> with replacements to level <code>Debug</code>.
     * 
     * @param message message of type {@link String} that needs to be logged.
     * @param replacements an Array of {@link String} replacements that will replace the tokens <code>##</code> in the
     *            message
     */
    void debug(String message, String[] replacements);

    /**
     * Logs messages replacing token <code>##</code> with replacements to level <code>Debug</code>.
     * 
     * @param message message of type {@link String} that needs to be logged.
     * @param replacement a {@link String} that will replace the tokens <code>##</code> in the message.
     */
    void debug(String message, String replacement);

    /**
     * Logs messages to level <code>Debug</code>. While providing implementations, developers can choose to log the
     * object as a <code>object.toString()</code> or converting them to XMLs.
     * 
     * @param object object that needs to be logged.
     */
    void debug(Object object);

    /**
     * Logs messages to level <code>Info</code>.
     * 
     * @param message message of type {@link String} that needs to be logged.
     */
    void info(String message);

    /**
     * Logs messages replacing all tokens <code>##</code> with replacements to level <code>Info</code>.
     * 
     * @param message message of type {@link String} that needs to be logged.
     * @param replacements an Array of {@link String} replacements that will replace the tokens <code>##</code> in the
     *            message
     */
    void info(String message, String[] replacements);

    /**
     * Logs messages replacing token <code>##</code> with replacements to level <code>Info</code>.
     * 
     * @param message message of type {@link String} that needs to be logged.
     * @param replacement a {@link String} that will replace the tokens <code>##</code> in the message.
     */
    void info(String message, String replacement);

    /**
     * Logs messages to level <code>Info</code>. While providing implementations, developers can choose to log the
     * object as a <code>object.toString()</code> or converting them to XMLs.
     * 
     * @param object object that needs to be logged.
     */
    void info(Object object);

    /**
     * Logs messages to level <code>Warn</code>.
     * 
     * @param message message of type {@link String} that needs to be logged.
     */
    void warn(String message);

    /**
     * Logs messages replacing all tokens <code>##</code> with replacements to level <code>Warn</code>.
     * 
     * @param message message of type {@link String} that needs to be logged.
     * @param replacements an Array of {@link String} replacements that will replace the tokens <code>##</code> in the
     *            message
     */
    void warn(String message, String[] replacements);

    /**
     * Logs messages replacing token <code>##</code> with replacements to level <code>Warn</code>. 
     * 
     * @param message message of type {@link String} that needs to be logged.
     * @param replacement a {@link String} that will replace the tokens <code>##</code> in the message.
     */
    void warn(String message, String replacement);

    

    /**
     * Logs messages to level <code>Warn</code>. While providing implementations, developers can choose to log the
     * object as a <code>object.toString()</code> or converting them to XMLs.
     * 
     * @param object object that needs to be logged.
     */
    void warn(Object object);

    /**
     * Logs messages to level <code>Error</code>.
     * 
     * @param message message of type {@link String} that needs to be logged.
     */
    void error(String message);

    /**
     * Logs messages replacing all tokens <code>##</code> with replacements to level <code>Error</code>.
     * 
     * @param message message of type {@link String} that needs to be logged.
     * @param replacements an Array of {@link String} replacements that will replace the tokens <code>##</code> in the
     *            message
     */
    void error(String message, String[] replacements);

    /**
     * Logs messages replacing token <code>##</code> with replacements to level <code>Error</code>. 
     * 
     * @param message message of type {@link String} that needs to be logged.
     * @param replacement a {@link String} that will replace the tokens <code>##</code> in the message.
     */
    void error(String message, String replacement);

    
    /**
     * Logs messages to level <code>Error</code>. While providing implementations, developers can choose to log the
     * object as a <code>object.toString()</code> or converting them to XMLs.
     * 
     * @param object object that needs to be logged.
     */
    void error(Object object);
}
